﻿using FluentValidation;
using Nop.Services.Localization;
using Nop.Web.Framework.Validators;
using Nop.Web.Models.WindAlert;

namespace Nop.Web.WindAlert.Validators
{
    public class SpotCommentValidator : BaseNopValidator<AddSpotCommentModel>
    {
        public SpotCommentValidator(ILocalizationService localizationService)
        {
            RuleFor(x => x.CommentText).NotEmpty().WithMessage(localizationService.GetResource("WindAlert.Spot.Comments.Text.Required"));
            RuleFor(x => x.SpotId)
                    .NotNull()
                    .WithMessage(localizationService.GetResource("Windalert.Spot.Comments.SpotId.Required"));
            RuleFor(x => x.SpotId)
                .NotEqual(0)
                .WithMessage(localizationService.GetResource("Windalert.Spot.Comments.SpotId.Required"));
        }
    }
}